package com.lxj.student_security.entity;

import com.carrotsearch.hppc.Generated;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Document(indexName = "es_log", shards = 2,replicas = 1)
public class LoginRecord implements Serializable {
    @Id
    private Integer id;
    private Integer userId;
    @Field(type = FieldType.Keyword)
    private String time;
    @Field(type = FieldType.Keyword)
    private String ip;
    @Field(analyzer = "ik_max_word" ,type = FieldType.Text)
    private String username;
    private Integer pageNum;
    private Integer pageSize;
}
